package com.lamatek.tags.google;

import javax.servlet.jsp.tagext.Tag;
import javax.servlet.jsp.tagext.TagSupport;


public class GoogleMapBlowupTag extends TagSupport {
    
    boolean display = false;
    String maptype = "map";
    int zoom = 1;
    /**
     * Overrides doStartTag() from TagSupport. Developers should not override this method.
     */
    public int doStartTag() {
        return SKIP_BODY;
    }
    /**
     * Overrides doEndTag() from TagSupport. Developers should not override this method.
     */
    public int doEndTag() {
        Tag tag = this;
        while (tag.getParent() != null) {
            if (tag.getParent() instanceof GoogleMapMarkerTag) {
                ((GoogleMapMarkerTag) tag.getParent()).setBlowup(this);
                return EVAL_PAGE;
            }
            tag = tag.getParent();
        }
        return EVAL_PAGE;
    }
    /**
     * Returns the specified map type for this blowup map. Valid values are map, hybrid, satellite
     * or null.
     * 
     * @return A string that references the desired blowup map type or null (which defaults to the current view).
     */
    public String getMaptype() {
        return maptype;
    }
    /**
     * Sets the specified map type for this blowup map. Valid values are map, hybrid, satellite
     * or null.
     * 
     * @param maptype A string that references the desired blowup map type or null (which defaults to the current view).
     */
    public void setMaptype(String maptype) {
        this.maptype = maptype;
    }
    /**
     * Returns the desired zoom level for this blowup map.
     * 
     * @return An int that denotes desired zoom level. Default is 1.
     */
    public int getZoom() {
        return zoom;
    }
    /**
     * Sets the desired zoom level for this blowup map.
     * 
     * @param zoom The desired zoom level.
     */
    public void setZoom(int zoom) {
        this.zoom = zoom;
    }
    /**
     * Sets whether or not this blowup map should be initially displayed. If set to
     * true then the map will be displayed. If set to false, the map will
     * only display after the user has clicked on the parent marker.
     * 
     * @param display True to display, false to require a click to display.
     */
    public void setDisplay(boolean display) {
        this.display = display;
    }
    /**
     * Returns true if this map is set to initially display. Returns false otherwise.
     * 
     * @return true or false.
     */
    public boolean isDisplay() {
        return display;
    }
}
